<!DOCTYPE html>
<html>
	<head>

		<title>资料下载</title>
		<meta name="keywords" content="" />
		<meta name="description" content="" />

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<link rel="stylesheet" type="text/css" href="style/style.css" />
		
		<script type="text/javascript" src="js/jquery-1.8.1.min.js"></script>
		<script src="js/angular.min.1.4.6.js"></script> 
		<script type="text/javascript" src="js/index.js"></script>
		<script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>
		<script type="text/javascript" src="layer/layer.js"></script>
		
	</head>

	<body   ng-app="indexApp">
		<div class="conter ma">
			<div class="header" ng-include="'header.html'" ></div>
			<div class="nybanner">
				<img src="images/nybanner.jpg" width="997" height="198" /></div>
			<div class="side">
				<div class="stitle">
					客户服务<span> </span></div>
				<div class="conts clicksub">
					<dl>

						<dt class='on'><a href="procedure.htm" >服务流程</a></dt>

						<dt class='on'><a href="report.htm" >报告查询</a></dt>

						<dt class='on'><a href="data.htm" >公告</a></dt>
						
						<dt class='on'><a href="download.htm" >资料下载</a></dt>

					</dl>
				</div>

				<div class="side_c">
					<p>
						<a href="mainBusiness.htm"><img src="images/sc1.jpg" width="226" height="73" /></a>
					</p>
					<p>
						<a href="auth.htm"><img src="images/sc2.jpg" width="226" height="74" /></a>
					</p>
					<p>
						<a href="train.htm"><img src="images/sc3.jpg" width="226" height="78" /></a>
					</p>
				</div>
			</div>
			<div class="mian">
				<div class="mtitle">
					资料下载<span>您的当前位置：<a href="home.htm" >主页</a> > <a href="download.htm" >资料下载</a> > 
                </span>
				</div>
				<div class="miancont">
					<div class="ny_news">

						<ul id="all">
							

						</ul>

						<div class="page"  id="pages">
							
						</div>

					</div>
				</div>
			</div>
			<div class="clear">
			</div>

			<div class="footer"ng-include="'footer.html'" ></div>

		</div>
		<script type="text/javascript">
		var rows=10;                //每页展示多少条数据
		var allPage="";            //当前总页数
		var nowPage=1;             //记录当前页码
		angular.module('indexApp', []).controller('indexContr', function($scope) {
			$(".menu ul li.dq").each(function() {
				$(this).hover(function() {

					$(this).find(".submenu").stop(false, true).slideDown();
				}, function() {

					$(this).find(".submenu").stop(false, true).slideUp();

				});
			});
			function menuon(id) {
				$(".menu ul li.dq a").each(function() {
					$(this).removeClass("on");
				});
				$(".menu ul li.dq").eq(id - 1).children("a").addClass("on");
			}
			$(".menu ul li .submenu .submenubg a:last-child").css("border-bottom", "none");
			menuon(3);
		});
		
function getdata(num){
			
			
			nowPage = num;
			var offset = rows*num-rows;
			$.ajax({  
			    type : "post",  
			    url : "information/getInfoList",  
			    data : {
			        "order":"asc",
			        "limit":rows,
			        "offset":offset,
			        "type":10,
			    },
			    success : function(res){  
			    	console.log(res);
			    	var data = res.rows;
					if(data.length == 0){
						$("#all").append("<li><a  class='wz'>没有数据！</a></li>");
						return;
					}
					pageslist(res);
					var text = '';
					
					for(var i=0;i<data.length;i++){
						var time = fmtDate(data[i].createdAt);
						text = text+'<li><a href="modeinfo.htm?id='+data[i].id+'" title="'+data[i].title+'" class="wz">'+data[i].title+'</a><span>'+time+'</span></li>';
						
					}
					$("#all li").remove();
					$("#all").append(text);
			    } ,
			    error : function(){
			    	$("#all").append("<li><a  class='wz'>获取数据失败，请刷新页面！</a></li>");
			    }
			});
			
		}
		getdata(1);
		function fmtDate(obj){
		    var date =  new Date(obj);
		    var y = 1900+date.getYear();
		    var m = "0"+(date.getMonth()+1);
		    var d = "0"+date.getDate();
		    return y+"-"+m.substring(m.length-2,m.length)+"-"+d.substring(d.length-2,d.length);
		}
	
	
		function pageslist(data){
			$("#pages a").remove();
			allPage=Math.ceil(data.total/rows);
			var prevpage= nowPage-1;
			var nextpage= nowPage+1;
			var pagescon = "<a href='javascript:' onclick='pagejump("+prevpage+")' class='prev'>上一页</a>";
			for(var i=1;i<=allPage;i++){
				if(i == nowPage){
					pagescon = pagescon + '<a class="num cur">'+i+'</a>';
				}else{
					pagescon = pagescon + '<a href="javascript:" onclick="pagejump('+i+')" class="num">'+i+'</a>';
				}
			}
			pagescon = pagescon + "<a href='javascript:' onclick='pagejump("+nextpage+")' class='next'>下一页</a>";	 
			$("#pages").append(pagescon);
			//var pagescon= '<div class="page"><a href="/content.aspx?node=306&amp;page=1" class="prev">上一页</a><a class="num cur">1</a><a href="/content.aspx?node=306&amp;page=1" class="next">下一页</a></div>';
		}
		function pagejump(num){
			if(num == 0){
				layer.msg('前面没有了哦！');
				return
			}else if(num>allPage){
				layer.msg('已经是最后一页了！');
				return
			}else{
				getdata(num);
			}
			
			
			
		}
		</script>

	</body>

</html>